﻿using Microsoft.AspNetCore.SignalR;

namespace WebApi.Hubs;

public class NameUserIdProvider : IUserIdProvider
{
    public string? GetUserId(HubConnectionContext connection)
    {
        return connection.User?.Identity?.Name ?? connection.User?.Claims.FirstOrDefault(c => c.Type == "name")?.Value;
    }
}
